package com.fengke.springbootjpademo.controller;

import com.fengke.springbootjpademo.entities.Users;
import com.fengke.springbootjpademo.repositories.UserReposity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class IndexController {
    @Autowired
    private UserReposity userReposity;

    @RequestMapping("/index")
    @ResponseBody
    public List<Users> index(){
        List<Users> users =userReposity.findAll();
        System.out.println("hello world");
        return users;
        }
    @RequestMapping("/test")
    @ResponseBody
    public String test()
    {
        return "你是不是傻:springboot 远程应用";
    }
    }
